<?php
	$aData = pg_fetch_array($resData);
?>
<form method="post" action="index.php?id=organisateur_modif_resultats">
<input type="hidden" name="numero" value=<?php echo '"' . $aData["numero"] . '"' ?> />
<table>
	<tr>
		<td>Date</td>
		<td><input type="date" name="dateheure" value=<?php echo '"' . $aData["dateheure"] . '"' ?> /></td>
	</tr>
	<tr>
		<td>Durée</td>
		<td><input type="text" name="duree" value=<?php echo '"' . $aData["duree"] . '"' ?> /></td>
	</tr>
	<tr>
		<td>Joueur 1 - Edition</td>
		<td>
			<select name="pseudoj1">
				<?php
					while($aData2 = pg_fetch_array($aPseudos1))
            		{
            			if($aData["editionj1"] == $aData2["edition"] && $aData["pseudoj1"] == $aData2["pseudo"])
                			echo '<option value="' . $aData2['pseudo'] . '#' . $aData2['edition'] .'" selected>' . $aData2['pseudo'] . ' - ' . $aData2['edition'] .  '</option>';
                		else
                			echo '<option value="' . $aData2['pseudo'] . '#' . $aData2['edition'] .'">' . $aData2['pseudo'] . ' - ' . $aData2['edition'] .  '</option>';
            		}
				?>
			</select>
		</td>
	</tr>
	<tr>
		<td>Points</td>
		<td><input type="text" name="pointegerj1" value=<?php echo '"' . $aData["pointegerj1"] . '"' ?> /></td>
	</tr>
	<tr>
		<td>Joueur 2 - Edition</td>
		<td>
			<select name="pseudoj2">
				<?php
					while($aData2 = pg_fetch_array($aPseudos2))
            		{
                		if($aData["editionj2"] == $aData2["edition"] && $aData["pseudoj2"] == $aData2["pseudo"])
                			echo '<option value="' . $aData2['pseudo'] . '#' . $aData2['edition'] .'" selected>' . $aData2['pseudo'] . ' - ' . $aData2['edition'] .  '</option>';
                		else
                			echo '<option value="' . $aData2['pseudo'] . '#' . $aData2['edition'] .'">' . $aData2['pseudo'] . ' - ' . $aData2['edition'] .  '</option>';
            		}
				?>
			</select>
		</td>
	</tr>
	<tr>
		<td>Points</td>
		<td><input type="text" name="pointegerj2" value=<?php echo '"' . $aData["pointegerj2"] . '"' ?> /></td>
	</tr>
	<tr>
		<td>Round</td>
		<td>
			<select name = "round">
				<?php if($round == "round1"){ ?>
					<option value="round1" selected>Round 1</option>
				<?php }else{ ?>
					<option value="round1">Round 1</option>
				<?php } ?>

				<?php if($round == "round2"){ ?>
					<option value="round2" selected>Round 2</option>
				<?php }else{ ?>
					<option value="round2">Round 2</option>
				<?php } ?>

				<?php if($round == "round3"){ ?>
					<option value="round3" selected>Round 3</option>
				<?php }else{ ?>
					<option value="round3">Round 3</option>
				<?php } ?>
			</select>
		</td>
	</tr>

</table>
<input type="submit" value="Valider"/>
</form>

<a href="index.php?id=organisateur_resultats">Retour</a>
